﻿<script type="text/javascript">
    $(function () {
        $('#ClassTime').blur(
        function () {
            //alert($(this).val());
            $(this).val($(this).val().replace("：", ":"));
        }
        );
    });
</script>

@model AuditModel.Archive

        <div class="editor-label">
            @AuditResources.Archive.AnnualEventID
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model=>model.AnnualEventID, (SelectList)ViewBag.AnnualEventIDList)
            @Html.ValidationMessageFor(model => model.AnnualEventID)
        </div>

        <div class="editor-label">
            @AuditResources.Archive.CountyCode
        </div>
        <div class="editor-field">
            @Html.DropDownList("CountyCode")
            @Html.ValidationMessageFor(model => model.CountyCode)
        </div>

        <div class="editor-label">
            @AuditResources.Archive.SubjectID
        </div>
        <div class="editor-field">
            @Html.DropDownList("SubjectID", String.Empty)
            @Html.ValidationMessageFor(model => model.SubjectID)
        </div>

        <div class="editor-label">
            @AuditResources.Archive.TeacherName
        </div>
        <div class="editor-field">
            @Html.EditorFor(model=>model.TeacherName)
            @Html.ValidationMessageFor(model=>model.TeacherName)
        </div>        
                
                
        <div class="editor-label">
           @AuditResources.Archive.PhotoUrl
        </div>
        <div class="editor-field">
        @if (Model != null&&!string.IsNullOrEmpty(Model.PhotoUrl))
        {
             @AuditWeb.Helpers.Image(this.Html, Model.PhotoUrl, Model.TeacherName, 150)
             @Html.Hidden("PhotoUrl", Model.PhotoUrl)
        }
        else
        {
            @AuditWeb.Helpers.Image(this.Html, "~/Content/photos/profile.jpg", "Profile", 150)
            @Html.Hidden("PhotoUrl", "~/Content/photos/profile.jpg")
        }
            <br />
             <input type="file" name="photo" id="photo" />
            @Html.ValidationMessageFor(model => model.PhotoUrl)
        </div>


        <div class="editor-label">
           @AuditResources.Archive.ClassTitle
        </div>
        <div class="editor-field">
            @Html.EditorFor(model=>model.ClassTitle)
            @Html.ValidationMessageFor(model => model.ClassTitle)
        </div>

        <div class="editor-label">
           @AuditResources.Archive.Birthdate
        </div>
        <div class="editor-field">
            @Html.TextBox("Birthdate", Model == null||Model.Birthdate==null ? "" : Model.Birthdate.Value.ToShortDateString())
            @Html.ValidationMessageFor(model => model.Birthdate)
        </div>

        <div class="editor-label">
           @AuditResources.Archive.Gender
        </div>
        <div class="editor-field">
            @Html.RadioButton("Gender", "男", Model == null || Model.Gender == "男")男
            @Html.RadioButton("Gender", "女", Model != null && Model.Gender == "女")女
            @Html.ValidationMessageFor(model => model.Gender)
        </div>

        <div class="editor-label">
           @AuditResources.Archive.PhoneNumber
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PhoneNumber)
            @Html.ValidationMessageFor(model => model.PhoneNumber)
        </div>

        <div class="editor-label">
           @AuditResources.Archive.EducationDegree
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.EducationDegree)
            @Html.ValidationMessageFor(model => model.EducationDegree)
        </div>

        <div class="editor-label">
           @AuditResources.Archive.GradeLevel
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.GradeLevel)
            @Html.ValidationMessageFor(model => model.GradeLevel)
        </div>

        <div class="editor-label">
           @AuditResources.Archive.TeachingYears
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TeachingYears)
            @Html.ValidationMessageFor(model => model.TeachingYears)
        </div>

        <div class="editor-label">
           @AuditResources.Archive.SchoolName
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SchoolName)
            @Html.ValidationMessageFor(model => model.SchoolName)
        </div>

        <div class="editor-label">
           @AuditResources.Archive.SchoolPrincipal
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SchoolPrincipal)
            @Html.ValidationMessageFor(model => model.SchoolPrincipal)
        </div>

        <div class="editor-label">
           @AuditResources.Archive.SchoolAddress
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SchoolAddress)
            @Html.ValidationMessageFor(model => model.SchoolAddress)
        </div>

        <div class="editor-label">
            @AuditResources.Archive.SchoolComment
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.SchoolComment, new { style = "width:500px" })
            @Html.ValidationMessageFor(model => model.SchoolComment)
        </div>

        <div class="editor-label">
            @AuditResources.Archive.CountyComment
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.CountyComment, new { style = "width:500px" })
            @Html.ValidationMessageFor(model => model.CountyComment)
        </div>

        <div class="editor-label">
            @AuditResources.Archive.CountyEBComment
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.CountyEBComment, new { style = "width:500px" })
            @Html.ValidationMessageFor(model => model.CountyEBComment)
        </div>

        <div class="editor-label">
            @AuditResources.Archive.Attachment1LessonPlan
        </div>
        <div class="editor-field">
            @if (Model != null && !string.IsNullOrEmpty(Model.Attachment1LessonPlan))
            {
             @Html.ActionLink(Model.Attachment1LessonPlan, "GetLessonPlan", "DownloadManager", new { id = Model.ID }, new { style = "display:inline-block;width:100px" })
             @Html.Hidden("Attachment1LessonPlan", Model.Attachment1LessonPlan)
            }
            else
            {
            <text>无</text>
                @Html.Hidden("Attachment1LessonPlan", "")
            }
             <input type="file" name="lessonplan" id="lessonplan" />
            @Html.ValidationMessageFor(model => model.Attachment1LessonPlan)
        </div>

        <div class="editor-label">
            @AuditResources.Archive.Attachment2Explanation
        </div>
        <div class="editor-field">
            @if (Model != null && !string.IsNullOrEmpty(Model.Attachment2Explanation))
            {
             @Html.ActionLink(Model.Attachment2Explanation, "GetExplanation", "DownloadManager", new { id = Model.ID }, new { style = "display:inline-block;width:100px" })
              @Html.Hidden("Attachment2Explanation", Model.Attachment2Explanation)
            }
            else
            {
            <text>无</text>
          @Html.Hidden("Attachment2Explanation", "")
            }
             <input type="file" name="explanation" id="explanation" />
            @Html.ValidationMessageFor(model => model.Attachment2Explanation)
           </div>

        @if (((SelectList)ViewBag.AvailableDates).Count() > 0)
        {
        <div class="editor-label">
            @AuditResources.Archive.ClassDate
        </div>
        <div class="editor-field">
            @Html.DropDownList("ClassDate", (SelectList)ViewBag.AvailableDates)
            @Html.ValidationMessageFor(model => model.ClassDate)
        </div>

        <div class="editor-label">
            @AuditResources.Archive.ClassTime
        </div>
        <div class="editor-field">
            @Html.TextBox("ClassTime", Model == null || Model.ClassTime == null ? "" : Model.ClassTime.Value.ToShortTimeString()) (时间格式24小时制hh:mm，如8:00, 20:00))
            @Html.ValidationMessageFor(model => model.ClassTime)
        </div>
        }
        else
    {
            <div class="editor-label">
            @AuditResources.Archive.ClassDate
        </div>
        <div class="editor-field">
            目前无法指定上课日期和时间。
        </div>
    }